package com.starsoft.smdc.util;

import com.starsoft.smdc.bean.SmdcSecurity;

public enum SecurityType {
	fund, stock, bond, index, other;
	
	public static boolean isFund(String type){
		return fund.name().equalsIgnoreCase(type);
	}
	
	public static boolean isStock(String type){
		return stock.name().equalsIgnoreCase(type);
	}
	
	public static boolean isBond(String type){
		return bond.name().equalsIgnoreCase(type);
	}
	
	public static boolean isIndex(String type){
		return index.name().equalsIgnoreCase(type);
	}
	
	public static boolean isOther(String type){
		return other.name().equalsIgnoreCase(type);
	}
	
	public static SecurityType get(SmdcSecurity security){
		String secType = security.getSecType();
		return SecurityType.valueOf(secType);
	}
}
